package com.kohler.blog.base.validator.annotation;

import com.kohler.blog.base.validator.constraint.IdValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * ID校验【注解】
 *
 */
@Documented
@Target({TYPE, ANNOTATION_TYPE, FIELD, METHOD})
@Retention(RUNTIME)
@Constraint(validatedBy = {IdValidator.class})
public @interface IdValid {
    boolean required() default true;

    String message() default "com.kohler.blog.base.validator.annotation.IdValid.message";

    String value() default "";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
